﻿@model Example7.MvcWebApp.ShardingOnly.Models.ShardingEntryEdit

@{
    ViewData["Title"] = "Edit";
}

<h1>Edit</h1>

<h4>Edit '@Model.DatabaseInfo.Name' information</h4>
<hr />
<div class="row">
    <div class="col-md-4">
        <form asp-action="Edit">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            @Html.Hidden("DatabaseInfo.Name", Model.DatabaseInfo.Name)
            <div class="form-group">
                <label asp-for="DatabaseInfo.DatabaseName" class="control-label"></label>
                <input asp-for="DatabaseInfo.DatabaseName" class="form-control" />
                <span asp-validation-for="DatabaseInfo.DatabaseName" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="DatabaseInfo.ConnectionName" class="control-label"></label>
                @Html.DropDownListFor(m => m.DatabaseInfo.ConnectionName, 
                    new SelectList(Model.AllPossibleConnectionNames))
                <span asp-validation-for="DatabaseInfo.ConnectionName" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="DatabaseInfo.DatabaseType" class="control-label"></label>
                @Html.DropDownListFor(m => m.DatabaseInfo.DatabaseType, 
                    new SelectList(Model.PossibleDatabaseTypes))
                <span asp-validation-for="DatabaseInfo.DatabaseType" class="text-danger"></span>
            </div>
            <div class="form-group">
                <input type="submit" value="Save" class="btn btn-primary" />
            </div>
        </form>
    </div>
</div>

<div>
    <a asp-action="Index">Back to List</a>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
